package top.mcwebsite.playandroid.common.user.api

import kotlinx.coroutines.flow.Flow
import top.mcwebsite.playandroid.common.user.api.model.UserData

/**
 * 用户的服务，用于获取用户信息
 */
interface IUserService {

    fun init()

    fun isLogin(): Boolean

    fun isLoginFlow(): Flow<Boolean>

    fun getCachedUserData(): UserData?

    suspend fun getUserInfo(): UserData

    fun setLogin(isLogin: Boolean)

    suspend fun logout()
}